package srcInterviewPrep;

import java.util.Deque;

public final class TowersOfHanoi
{
    public static void MoveDisks(
        int numDisks,
        Deque sourceStack,
        Deque destinationStack,
        Deque bufferStack)
    {
        if (numDisks == 0)
        {
            return;
        }
        
        MoveDisks(numDisks - 1, sourceStack, bufferStack, destinationStack);
        
        destinationStack.addFirst(sourceStack.removeFirst());
        
        MoveDisks(numDisks - 1, bufferStack, destinationStack, sourceStack);
    }
}
